Skip to content

[MISC] Move register-tile Cholesky into quadrants.#2860

Merged
duburcqa merged 4 commits into
Genesis-Embodied-AI:mainfrom
hughperkins:hp/move-tiles-into-quadrants
Jun 5, 2026
Merged

[MISC] Move register-tile Cholesky into quadrants.#2860
duburcqa merged 4 commits into
Genesis-Embodied-AI:mainfrom
hughperkins:hp/move-tiles-into-quadrants

Conversation

@hughperkins
Copy link
Copy Markdown
Collaborator

Delete genesis/utils/_tile16.py and _tile32.py, whose contents (the inlined column-setter cascades + qd.static-unrolled cholesky_ body) now live in quadrants/lang/simt/_tile16.py and _tile32.py upstream. The constraint solver switches from Tile16x16Cholesky / Tile32x32Cholesky to qd.simt.Tile16x16 / qd.simt.Tile32x32, and the blocked-Cholesky bodies go back to the readable slice syntax (tile[:] = arr[r:r2, c:c2], tile -= qd.outer(v, v)) instead of the explicit _load3d / _store3d / _resolve_vec3d / _ger_sub private calls that were required while two distinct tile classes co-existed in one kernel.

Pairs with quadrants PR hp/import-tiles-from-genesis.

Description

Related Issue

Resolves Genesis-Embodied-AI/Genesis#

Motivation and Context

How Has This Been / Can This Be Tested?

Screenshots (if appropriate):

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Delete `genesis/utils/_tile16.py` and `_tile32.py`, whose contents (the
inlined column-setter cascades + qd.static-unrolled cholesky_ body) now live
in `quadrants/lang/simt/_tile16.py` and `_tile32.py` upstream. The constraint
solver switches from `Tile16x16Cholesky` / `Tile32x32Cholesky` to
`qd.simt.Tile16x16` / `qd.simt.Tile32x32`, and the blocked-Cholesky bodies go
back to the readable slice syntax (`tile[:] = arr[r:r2, c:c2]`,
`tile -= qd.outer(v, v)`) instead of the explicit `_load3d` / `_store3d` /
`_resolve_vec3d` / `_ger_sub` private calls that were required while two
distinct tile classes co-existed in one kernel.

Pairs with quadrants PR hp/import-tiles-from-genesis.
Comment on lines 2113 to 2133
@@ -2130,11 +2125,11 @@ def func_cholesky_and_solve_fused_tiled(
"""Tile-size dispatcher; see _cholesky_and_solve_fused_tiled_impl for the algorithm and dispatch rule."""
if qd.static(static_rigid_sim_config.cholesky_tile_size == 32):
_cholesky_and_solve_fused_tiled_impl(
constraint_state, rigid_global_info, static_rigid_sim_config, Tile32x32Cholesky, write_L_to_nt_H
constraint_state, rigid_global_info, static_rigid_sim_config, qd.simt.Tile32x32, write_L_to_nt_H
)
else:
_cholesky_and_solve_fused_tiled_impl(
constraint_state, rigid_global_info, static_rigid_sim_config, Tile16x16Cholesky, write_L_to_nt_H
constraint_state, rigid_global_info, static_rigid_sim_config, qd.simt.Tile16x16, write_L_to_nt_H
)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to have qd.simt.Tile that accept static "size" argument, so that ce can pass size as input argument instead of entire class? This would be more idiomatic.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And even more natural and cleaner, because you would just have to pass "static_rigid_sim_config.cholesky_tile_size" directly inside _cholesky_and_solve_fused_tiled_impl instead of adding one more indirection level as it is currently the case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be better to comment these on the quadrants-side PR. I've already merged that though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(No way to modify such parameters from genesis side)

duburcqa
duburcqa previously approved these changes Jun 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 4, 2026

🔴 Benchmark Regression Detected ➡️ Report

@hughperkins hughperkins marked this pull request as ready for review June 4, 2026 22:16
@hughperkins hughperkins requested a review from YilingQiao as a code owner June 4, 2026 22:16
@duburcqa duburcqa changed the title [MISC] Move register-tile Cholesky out of genesis into quadrants. [MISC] Move register-tile Cholesky into quadrants. Jun 5, 2026
@duburcqa duburcqa merged commit bde113d into Genesis-Embodied-AI:main Jun 5, 2026
22 of 23 checks passed
@hughperkins hughperkins deleted the hp/move-tiles-into-quadrants branch June 5, 2026 14:07
@hughperkins
Copy link
Copy Markdown
Collaborator Author

🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants